/* 公共方法--tab切换 */
function tabControl(defaultIndex,el){
    var el = el || '.tab',
    tab_head = el + '__head',
    tab_body = el + '__body',
    tab_headItem = tab_head + '__item',
    tab_bodyItem = tab_body + '__item';
    $(el).each(function(){
        console.log('aaa')
        var head = $(tab_headItem,this);
        var body = $(tab_bodyItem,this);
        head.on('click',function(){
            head.removeClass('active');
            $(this).addClass('active').show();
            if(!head.parent().is(tab_head)){
                var index = $(this).index(tab_head + " " +tab_headItem);
            }else{
                var index = $(this).index();
            }
            body.eq(index).show().siblings().hide();
        });
        head.eq(defaultIndex ? defaultIndex : 0).trigger('click');
    })
}
/* 
<div class="tab">
    <div class="tab__head">
        <div class="tab__head__item">1</div>
        <div class="tab__head__item">2</div>
        <div class="tab__head__item">3</div>
    </div>
    <div class="tab__body">
        <div class="tab__body__item">11</div>
        <div class="tab__body__item">22</div>
        <div class="tab__body__item">33</div>
    </div>
</div>
*/